package com.xjscrm.console.chat.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.ToStringSerializer;

/**
 * @author mingyang.chen create in 2024/3/19 16:26
 */
public class JsonUtils {

    static final SerializeConfig config = new SerializeConfig();

    static {
        config.put(Long.class, new ToStringSerializer());
        config.put(Long.TYPE, new ToStringSerializer());
    }

    public static String toJson(Object source) {
        return JSON.toJSONString(source, config);
    }
}
